package com.lvmama.rhino.web;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.github.pagehelper.PageInfo;
import com.lvmama.rhino.entity.LogConditionVO;
import com.lvmama.rhino.pojo.Log;
import com.lvmama.rhino.service.LogService;

@RequestMapping("log")
@Controller
public class LogController {

	@Autowired
	private LogService logService;

	@RequiresPermissions("sys:log:view")
	@RequestMapping("list")
	public String logList(LogConditionVO condition, Model model) {
		PageInfo<Log> page = logService.findList(condition);
		model.addAttribute("page", page);
		model.addAttribute("logs", page.getList());
		model.addAttribute("condition", condition);

		return "application/logList";
	}
}
